{% extends "layout.html" %}

{% block body %}


<form class="form-horizontal" method="post" enctype=multipart/form-data>
  <div class="form-group">
      {{ label("服务器端导入文件")}}
    <div class="col-sm-4">
      <div class="input-group">
        <input type="text"  class="form-control" id="ServerPath" name="ServerPath" value="{{ ServerPath|e }}" size="200" >
            <span class="input-group-btn">
                <button class="btn btn-default" type="button"  data-toggle="modal" data-target="#FileModal">
                    <span id=OpenTaxoLB class="glyphicon glyphicon-folder-open" aria-hidden="true"></button>
                </span>
      </div> <!-- /input-group -->
    </div> <!-- col-sm-4 -->
  </div><!-- /form-group -->

<div class="form-group">
      {{ label("或本地文件上传")}}
    <div class="col-sm-4">
        <input type="file"  id="uploadfile" name="uploadfile"  size="200" >
    </div> <!-- col-sm-4 -->
  </div><!-- /form-group -->

   <input type="hidden" name="starttask" value="Y">
    <div class="form-group">
    <div class="col-sm-offset-2 col-sm-2">
      <button type="submit" class="btn btn-primary">开始任务</button>
    </div>
  </div>
</form>

   <script>
$(document).ready(function() {
    $('#FileModal').on('show.bs.modal', function (e) {
         $("#FileModalBody").html("Loading...");
         $("#FileModalBody").load("/common/ServerFolderSelect?ZipOnly=Y");
    });
    }); // Ready
 </script>

<!-- Modal -->
<div class="modal " id="FileModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="ModalLabel">Select a File</h4>
      </div>
      <div class="modal-body">
        <div id="FileModalBody">...</div>
      </div>
    </div>
  </div>
</div>

{% endblock %}